﻿//双击事件
//function CustomDbClick() {
//    var recordID = myDataTable.getSelectedRows()[0];
//    record = myDataTable.getRecord(recordID);
//    document.getElementById("EditUIWindow").src = "../../TR/IndagateCompare.aspx?id=" + record.getData(const_entityID);
//    YAHOO.example.container.dialog1.show();
//}
//双击事件
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    document.getElementById("EditUIWindow3").src = "AutoEditUI.aspx?r=" + Math.random() + "&action=check&entity=" + const_EditEntity + "&id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog5.show();

    //    document.getElementById('dialog1_h').innerText = "课程活动详情";
    //    document.getElementById('yui-gen7-button').style.display = "none";
}
if (typeof ($) != "undefined") {
    $(document).ready(function () {
        try {

            var varStr = $("form").attr("action");
            var arr = varStr.split('&');
            var arr2 = new Array();
            for (var i = 1; i < arr.length; i++) {
                arr2.push(arr[i]);
            }
            var varCheck = arr2[0].substring(7, arr2[0].length);
            if (varCheck == "check") {
                $("#btnTrCustomID").hide();
                $("#btnPrincipalHrmanno").hide();
                $("#btnSelectCourse").hide();
                $("#BudgetCost").attr("disabled", "disabled");
                $("#StartTime").attr("disabled", "disabled");
                $("#ActivityName").attr("disabled", "disabled");
                $("#EndTime").attr("disabled", "disabled");
                $("#ActivitySumary").attr("disabled", "disabled");
                $("#ActivityStatus").attr("disabled", "disabled");
                $("#ActivityContent").attr("disabled", "disabled");

                //                $("#fieldForm").wrap("<span id='wrap'></span>");
                //                var obj = document.getElementById("wrap");
                //                obj.onmouseover = function () {
                //                    obj.setCapture();
                //                }
                //                obj.onmouseout = function () {
                //                    obj.releaseCapture();
                //                }
                //                obj.onfocus = function () {
                //                    obj.blur();
                //                }
                //                obj.onbeforeactivate = function () {
                //                    return false;
                //                }
            }
        } catch (Error) { }
    })
}
//选择课程
//var pId;
//var conditonId;
//var selectId;
var fnSelectCourse = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    var pId = record.getData(const_entityID);
    var conditonId = "TrActivityID='" + pId + "'";
    var selectId = "TrCourseID";
    document.getElementById("EditUIWindow").src = "../EditWidows/YUIMenuList.aspx?pid=" + pId + "&selectid=" + selectId + "&conditonid=" + conditonId + "&masterentity=TrActivityCourse&masterPara=TrCourse|CourseName|TrCourseID|True";
    YAHOO.example.container.dialog1.show();
}
//调研对比
var fnCompare = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("EditUIWindow").src = "../../TR/IndagateCompare.aspx?id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog1.show();
}



